package org.yangspring.samples.mvc.serviceOracle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yangspring.samples.mvc.daoOracle.EmployeeDAO;
import org.yangspring.samples.mvc.domainOracle.Employee;

import java.util.List;

import static java.lang.System.out;

/**
 * Created by whyang on 2017/06/22.
 */

@Service
public class EmployeeServiceImpl implements EmployeeService {

    private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceImpl.class);

    @Autowired
    private EmployeeDAO empDao;

//    public void setEmpDao(EmployeeDAO empDao){
//        this.empDao = empDao;
//    }

    @Transactional
    public List<Employee> listEmp(){

        logger.warn("\nOracle EmployeeServiceImpl\n");

        /*if (this.empDao == null){
            logger.warn("\n\nOracle Servier 's empDao is null?\n\n");
        }*/
        return this.empDao.listEmp();
    }

}
